<template>
    <div class="borderradbottom" style="position: relative;color: #fff;background-color: var(--van-primary-color);">
        <Userinfo></Userinfo>
    </div>
    <Tabs v-model:active="active">
        <template v-for="value, prop in aside" :key="prop">
            <Tab :title="value.name" :name="value.router"></Tab>
        </template>
    </Tabs>
    <router-view></router-view>
</template>

<script setup lang="ts">
import { headStore, navBarStore } from "@b/store";
import { Tab, Tabs } from "vant";
import Userinfo from "@b/srcm/components/Log/user_info.vue";
import { ref, watch, onUnmounted } from "vue";
import { useRouter } from "vue-router";

const aside = headStore().asideOption
const sNavBar = navBarStore()
const router = useRouter();
// sNavBar.setNavBar('医护上门')
const active = ref('');
watch(() => active.value, (newVal) => {
    router.push(newVal)
})

sNavBar.setBackground('var(--van-primary-color)')
sNavBar.setColor('var(--van-white)')

onUnmounted(() => {
    sNavBar.setBackground('var(--van-background-2)')
    sNavBar.setColor('var(--van-text-color)')
})
</script>
